#ifndef _M1_CMD_H_
#define _M1_CMD_H_

#include "cmdpboc.h"

/*
**************************************************************************************************************
*										  常 量
**************************************************************************************************************
*/
#define	DEF_CZ_MiOneCard			( 0UL )	 		//标准M1
#define DEF_CZ_Mobile24Card			( 24000UL )		//移动2.4G
#define DEF_CZ_Telecom24Card		( 25000UL )		//电信2.4G
#define DEF_CZ_Unicom24Card			( 26000UL )		//联通2.4G

//卡操作模式定义
#define OLNY_REQUST					0x00        	//A密码、寻卡、不校验(其实已经包含校验密码)   
#define OLNY_AUTH    				0x0C        	//A密码、不寻卡、校验  
#define NO_REQUST_AUTH				OLNY_REQUST     //A密码、不寻卡、不校验,,,,,必须，每次都要检验密码 

//zj20101025添加
#define OLNY_REQUST_B				0x01        	//B密码、寻卡、不校验(其实已经包含校验密码)   
#define OLNY_AUTH_B    				0x0D        	//B密码、不寻卡、校验  
#define NO_REQUST_AUTH_B			OLNY_REQUST_B   //B密码、不寻卡、不校验 

#define PICC_ADD					0xC1			//加
#define PICC_SUB					0xC0			//减
#define PICC_RESTORE       			0xC2      		//恢复

#define PICC_KEYA 					0x60 			//KEY A
#define PICC_KEYB 					0x61			//KEY B

#define PICC_NULL 					0x00			//不校验KEY

extern U08 gM1CardSN[8];

extern U32 M1Card_Hook_7816APDU( U08 *in, U32 inlen, U08 *out, U32 *outLen, U32 maxsize );

extern U32 APP_M1Card_Hook_Value( U08 cmd, U08 Block, U08 *Value, U08 TranBlock );

extern U32 APP_M1Card_Hook_BlkWrite( U08 Mode, U08 Block, U08 *pBuffer, U08 *pKey );

extern U32 APP_M1Card_Hook_BlkRead( U08 Mode, U08 Block, U08 *pBuffer, U08 *pKey );

extern U32 APP_M1Card_Hook_AuthBlkKey( U08 Mode, U08 Block, U08 *pKey );

#endif

